var express = require('express');
var router = express.Router();
var connection=require('../db/sql.js')
router.all("*", function(req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Headers", "X-Requested-With");
    res.header("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE,OP0TIONS");
    res.header("X-Powered-By", "Express");
    res.header("Content-Type", "text/html; charset=UTF-8");
    next();
});
/* GET home page. */
router.get('/getpayment', function(req, res, next) { //获取所有医生
	connection.query('select * from payment', (err, result) => {
		if (err) throw err;
		res.send({
			data: result
		})
	})
})


module.exports = router;
